@extends("index")

@section("content")
    <div role="tabpanel" class="tab-pane" id="clients">
      <br>
      <div id="ClientsTable"></div>
    </div>
@stop

@section("script")
<script type="text/javascript">
	
          $(".menu .jichu-item").toggleClass("hidden");
  $("#kehu").addClass("active");
	
  $('#ClientsTable').jtable({
    title: '厂商管理',
    actions: {
        listAction: '/getclientslist',
        createAction: '/addclient',
        updateAction: '/editeclient',
        deleteAction: '/deleteclient'
    },
    fields: {
        id: {
            key: true,
            list: false
        },
        姓名: {
            title: '姓名',
        },
        性别: {
            options: { 1: '男', 2: '女', 0: '未定义' },
            title: '性别',
        },
        地址: {
            title: '地址',
        },
        电话: {
            title: '电话',
        },
        年龄: {
            title: '年龄',
            input: function (data) {
        if (data.record) {
            return '<input type="text" name="年龄" style="width:200px" value="' + data.record.年龄 + '"/>';
        } else {
            return '<input type="text" name="年龄" style="width:200px" value=""/>';
        }
    }
        },
    }
  });
  $('#ClientsTable').jtable('load');
</script>
@stop